# -*- coding: utf-8 -*-
"""
Created on Thu Sep 28 08:18:04 2017

@author: Luther
"""

while True:
    try:
        (a, b, c) = (5888, 6888, 8888)
        type = int(input('请输入苹果型号（1=iPhone8，2=iPhone8 Plus，3=iPhone X）：'))
        if type == 1:
            sum = a
            print('你购买的iPhone8的价格是:', sum)
            break
        elif type == 2:
            sum = b
            print('你购买的iPhone8 Plus的价格是:', sum)
            break
        elif type == 3:
            sum = c
            print('你购买的iPhone X的价格是:', sum)
            break
        else:
            print('输入值不合法，请重新输入！')
    except:
        print('输入值不合法，请重新输入！')
